package com.firewolf.spring;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.firewol.spring.entities.CPU;
import com.firewol.spring.entities.Computer;

/**
 * 
 * @author lx
 *
 */
public class MainDriver {
	
	private ApplicationContext ctx = null;
	
	/**
	 * 初始化
	 */
	@Before
	public void init(){
		ctx = new ClassPathXmlApplicationContext("spring.xml");
	}
	
	@Test
	public void testExtentd(){
		CPU cup1 = (CPU) ctx.getBean("cpu1");
		System.out.println(cup1);
		CPU cup2 = (CPU) ctx.getBean("cpu2");
		System.out.println(cup2);
	}
	@Test
	public void testDepends(){
		Computer cp = (Computer) ctx.getBean("cp");
		System.out.println(cp);
	}
	
}                                                                                     
